From: Paul Eggert Date: Mon, 21 Mar 2011 02:40:27 +0000 (-0700) Subject: * fileio.c (Fcopy_file): Report error if fchown or fchmod fail. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4324^2~21 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=c4d28d3077542c2deeac0a9fe4789ea9a3414477;p=emacs.git * fileio.c (Fcopy_file): Report error if fchown or fchmod fail. --- diff --git a/src/ChangeLog b/src/ChangeLog index b553ba7423c..0451408de62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-21 Paul Eggert + + * fileio.c (Fcopy_file): Report error if fchown or fchmod fail. + 2011-03-20 Paul Eggert * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303). diff --git a/src/fileio.c b/src/fileio.c index 5d33fb93878..7d2f10d517c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1951,9 +1951,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */) owner and group. */ if (input_file_statable_p) { - if (! NILP (preserve_uid_gid)) - fchown (ofd, st.st_uid, st.st_gid); - fchmod (ofd, st.st_mode & 07777); + if (!NILP (preserve_uid_gid) && fchown (ofd, st.st_uid, st.st_gid) != 0) + report_file_error ("Doing chown", Fcons (newname, Qnil)); + if (fchmod (ofd, st.st_mode & 07777) != 0) + report_file_error ("Doing chmod", Fcons (newname, Qnil)); } #endif /* not MSDOS */